package com.demo.springcloud.service;

import com.demo.springcloud.controller.impl.FeignOrderServiceImpl;
import com.demo.springcloud.entity.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author hxg
 * @version 1.0
 * @date 2021/12/28 9:51
 */
@Component
//@FeignClient("CLOUD-PAYMENT-SERVICE")
//测试feign接口调用时的服务降级
@FeignClient(value = "CLOUD-PROVIDER-PAYMENT-HYSTRIX-SERVICE",fallback = FeignOrderServiceImpl.class)
public interface FeignOrderService {
    @GetMapping("/payment/get/{id}")
    public R get(@PathVariable("id") Long id);

    @GetMapping("/payment/timeoutTest")
    public R timeoutTest();

    @GetMapping("/payment/hystrix/fail/{id}")
    public String paymentFail(@PathVariable("id") Long id);


}

